#include<bits/stdc++.h>
using namespace std;
const int p=1e9+7,D=1e7;
const int R[101][4]={{1,0,0,0},
{481076260,646782948,563929604,563929604},
{293781777,38063375,165922576,165922576},
{113710947,273163780,693437367,693437367},
{466899828,803209531,135054676,135054676},
{5742141,369449846,687595997,687595997},
{730494885,956745438,343620158,343620158},
{850337471,316977610,83657537,83657537},
{797255829,257037125,527146477,527146477},
{970328689,579196077,774762383,774762383},
{498816974,748433007,123624987,123624987},
{806912184,996324802,901618493,901618493},
{316925429,942444811,629685120,629685120},
{695152547,349694939,522423743,522423743},
{958980219,624350071,791665145,791665145},
{810456559,952333212,381394882,381394882},
{127603688,19017794,73310741,73310741},
{40574939,772880155,406727547,406727547},
{189690627,90641116,640165875,640165875},
{273547696,574485102,424016399,424016399},
{462322807,967822866,215072833,215072833},
{770557012,796215600,783386306,783386306},
{719955940,113481989,916718968,916718968},
{401592401,476599166,939095787,939095787},
{554934103,36193637,295563870,295563870},
{20905270,971630537,996267907,996267907},
{403423848,313728890,358576369,358576369},
{275561450,591999176,433780313,433780313},
{266270853,99610294,682940577,682940577},
{259514049,318315258,788914657,788914657},
{753027920,227448399,990238163,990238163},
{321274616,417166777,869220700,869220700},
{980012800,686769836,833391318,833391318},
{586040882,589637874,587839378,587839378},
{136039628,509129454,322584541,322584541},
{237083832,276891897,756987868,756987868},
{863648597,302985111,583316854,583316854},
{371766068,69020613,720393344,720393344},
{297624248,601558666,449591457,449591457},
{843829976,420390147,132110058,132110058},
{113552171,253260846,683406512,683406512},
{770248374,113184601,941716491,941716491},
{96640342,963095146,529867744,529867744},
{252290401,384802734,818546571,818546571},
{466915531,800039687,633477609,633477609},
{840892172,643743144,742317658,742317658},
{829564095,73180968,951372535,951372535},
{675460245,632349427,653904836,653904836},
{142611319,960355853,551483586,551483586},
{59329685,648626459,353978072,353978072},
{273785802,288714202,281250002,281250002},
{422402728,718579680,570491204,570491204},
{737893060,303587591,20740322,20740322},
{789426961,133932386,961679677,961679677},
{384442457,649321219,516881838,516881838},
{743606995,678292013,710949504,710949504},
{158833665,427071378,792952525,792952525},
{488848728,782065665,135457193,135457193},
{268722614,113064007,690893314,690893314},
{949791348,993899260,971845304,971845304},
{370929438,409976814,390453126,390453126},
{391081218,84323407,737702316,737702316},
{817152033,340269254,78710640,78710640},
{280719322,599886619,940302974,940302974},
{890740773,557175522,223958144,223958144},
{3583990,591764734,297674362,297674362},
{809842596,458485098,634163847,634163847},
{980845642,870836257,425840946,425840946},
{100189812,809851662,455020737,455020737},
{898143457,957860655,928002056,928002056},
{665859834,637908383,151884105,151884105},
{179132243,516714337,347923290,347923290},
{281223572,947956177,114589871,114589871},
{983780921,993031,492386976,492386976},
{227732163,346158808,786945489,786945489},
{987800070,11266912,499533491,499533491},
{69004954,270639140,169822047,169822047},
{637098062,721347025,179222540,179222540},
{474587689,946147464,210367573,210367573},
{204759805,242468861,223614333,223614333},
{865592790,131966756,498779773,498779773},
{871778485,345526697,608652591,608652591},
{737606888,970740952,854173920,854173920},
{990978388,655981467,323479924,323479924},
{725058553,605587591,665323072,665323072},
{951316542,237930432,594623487,594623487},
{460007740,185821477,822914612,822914612},
{480656439,699441904,90049168,90049168},
{448154144,914243729,181198933,181198933},
{717016439,816011086,266513759,266513759},
{570061123,600790512,85425814,85425814},
{112619149,872809979,492714564,492714564},
{968978531,163488412,66233468,66233468},
{26373231,928263417,477318324,477318324},
{511994367,896375044,204184702,204184702},
{578293029,107286389,342789709,342789709},
{96888731,890954408,993921573,993921573},
{816275024,347201192,581738108,581738108},
{26891587,610979313,318935450,318935450},
{993947663,94546862,44247259,44247259}};
inline int add(int x,int y){
  int s=x+y; if(s>=p)s-=p; return s;
}
inline void chadd(int &x,int y){
  if((x+=y)>=p)x-=p;
}
inline int qpow(int a,int b){
  int r=1;
  while(b){
    if(b&1)r=1ll*r*a%p;
    a=1ll*a*a%p,b>>=1;
  }
  return r;
}
int main(){
  freopen("pearl.in","r",stdin);
  freopen("pearl.out","w",stdout);
  ios::sync_with_stdio(false);
  int n,m,x,y=0,r=0; string Y; cin>>n>>m>>x>>Y;
  if(n<=8&&m<=3){
    const int L=1<<m;
    for(int i=0,s=1;i<m;i++,s<<=1)
      y+=s*(Y[i]&1);
    vector<int> a(n);
    function<void(int)> dfs=[&](int d){
      if(d+1==x){
        a[d]=y,dfs(d+1); return;
      }
      if(d==n){
        int c=0;
        for(int i=1;i<n;i++)
          c^=a[i-1]*a[i]&L-1;
        chadd(r,c); return;
      }
      for(int i=0;i<L;i++)
        a[d]=i,dfs(d+1);
    };
    dfs(0);
  }
  else if(x==1&&Y=="0"&&m==1){
    n--; int a00=R[n/D][0],a01=R[n/D][1],
      a10=R[n/D][2],a11=R[n/D][3];
    for(int i=n/D*D+1;i<=n;i++){
      int b00=add(a00,a10),b01=add(a01,a11),b10=add(a00,a11);
      a11=add(a01,a10),a00=b00,a01=b01,a10=b10;
    }
    r=add(a01,a11);
  }
  else if(n<=1000&&m<=5){
    const int L=1<<m;
    for(int i=0,s=1;i<m;i++,s<<=1)
      y+=s*(Y[i]&1);
    vector<vector<vector<int> > >
      f(n+1,vector<vector<int> >(L,vector<int>(L)));
    f[0][0][0]=1;
    for(int i=1;i<=n;i++)
      for(int j=0;j<L;j++)
        if(i!=x||j==y)
          for(int k=0;k<L;k++)
            for(int r=0;r<L;r++)
              chadd(f[i][j][r^j*k&L-1],f[i-1][k][r]);
    for(int i=0;i<L;i++)
      for(int j=0;j<L;j++)
        chadd(r,1ll*f[n][i][j]*j%p);
  }
  cout<<r<<endl;
  return 0;
}